package rabbitmq.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;


/**
 * @Auther: liyanhao
 * @Description: 通用消费者类
 * @Date: 2022/5/12 17:11
 * @Version: v1.0
 */
@Slf4j
@Component
public class Consumer {
    public static final String CONFIRM_QUEUE_NAME = "confirm.queue";

    @RabbitListener(queues = CONFIRM_QUEUE_NAME)
    public void receiveConfirmMessage(String msg,Message message) {
        log.info("接受到的队列confirm.queue消息:"+msg);
        System.out.println("");
    }
}
